<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信号灯与停车区关联管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
	<style>
		.control {
			margin: 2% 0% 0% 25%;
		}
		.form-ac {
			text-align: -webkit-center;
			margin-top: 5%;
		}
		a.select2-choice {
			width: 274px;
		}
	</style>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/signallight/tSignalLight/">信号灯与停车区关联列表</a></li>
		<li class="active"><a href="${ctx}/signallight/tSignalLight/form?id=${tSignalLight.id}">信号灯与停车区关联<shiro:hasPermission name="signallight:tSignalLight:edit">${not empty tSignalLight.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="signallight:tSignalLight:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="tSignalLight" action="${ctx}/signallight/tSignalLight/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<%--<div class="control">--%>
			<%--<label class="control-label">信号灯编号：</label>--%>
			<%--<div class="controls">--%>
				<%--<form:input path="lightcode" htmlEscape="false" maxlength="64" class="input-xlarge "/>--%>
			<%--</div>--%>
		<%--</div>--%>
		<div class="control">
			<label class="control-label">停车区域：</label>
			<div class="controls">
				<form:radiobuttons path="areaid" items="${fns:getAreaInfoList()}" itemLabel="areaName" itemValue="id" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control">
			<label class="control-label">信号灯名称：</label>
			<div class="controls">
				<form:input path="lightname" htmlEscape="false" maxlength="64" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control">
			<label class="control-label">ip：</label>
			<div class="controls">
				<form:input path="ip" htmlEscape="false" maxlength="64" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control">
			<label class="control-label">端口：</label>
			<div class="controls">
				<form:input path="port" htmlEscape="false" maxlength="64" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control">
			<label class="control-label">信号灯方向：</label>
			<div class="controls">
				<form:select path="lightdirection" class="input-xlarge required">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('light_direction')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control">
			<label class="control-label">信号灯状态：</label>
			<div class="controls">
				<form:radiobuttons path="status" items="${fns:getDictList('light_status')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="form-ac">
			<shiro:hasPermission name="signallight:tSignalLight:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>